﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Hyjx.GF.Database.Migrations
{
    /// <inheritdoc />
    public partial class CreateDb : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "MixerDataReports",
                columns: table => new
                {
                    SerialNumber = table.Column<long>(type: "INTEGER", nullable: false)
                        .Annotation("Sqlite:Autoincrement", true),
                    DeviceName = table.Column<string>(type: "TEXT", nullable: false),
                    DeviceCode = table.Column<string>(type: "TEXT", nullable: false),
                    RecordTime = table.Column<DateTime>(type: "TEXT", nullable: false),
                    Step = table.Column<short>(type: "INTEGER", nullable: false),
                    Material = table.Column<string>(type: "TEXT", nullable: false),
                    ElapsedTime = table.Column<short>(type: "INTEGER", nullable: false),
                    RemainTime = table.Column<short>(type: "INTEGER", nullable: false),
                    StirRotateSpeed = table.Column<short>(type: "INTEGER", nullable: false),
                    StirRotateActualSpeed = table.Column<float>(type: "REAL", nullable: false),
                    ScatteredRotateSpeed = table.Column<short>(type: "INTEGER", nullable: false),
                    ScatteredRotateActualSpeed = table.Column<float>(type: "REAL", nullable: false),
                    Temperature = table.Column<float>(type: "REAL", nullable: false),
                    ActualTemperature = table.Column<float>(type: "REAL", nullable: false),
                    Pressure = table.Column<float>(type: "REAL", nullable: false),
                    ActualPressure = table.Column<float>(type: "REAL", nullable: false),
                    MaterialWeight = table.Column<float>(type: "REAL", nullable: false),
                    MaterialActualWeight = table.Column<float>(type: "REAL", nullable: false),
                    StirCurrent = table.Column<float>(type: "REAL", nullable: false),
                    ScatteredCurrent = table.Column<float>(type: "REAL", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_MixerDataReports", x => x.SerialNumber);
                });

            migrationBuilder.CreateIndex(
                name: "IX_MixerDataReports_DeviceName_Material_RecordTime",
                table: "MixerDataReports",
                columns: new[] { "DeviceName", "Material", "RecordTime" });

            migrationBuilder.CreateIndex(
                name: "IX_MixerDataReports_DeviceName_RecordTime",
                table: "MixerDataReports",
                columns: new[] { "DeviceName", "RecordTime" });
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "MixerDataReports");
        }
    }
}
